﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace 枚举类型转换
{
    class Program
    {
        enum SystemVersion
        {
            Windows98=0,
            Windows2000=2,
            WindowsXP=4,
            Windows2013=8,
            Windows7=16,
            Windows2008=32,
            Windows10=64,
            Windows2012=128,
        }
        static void Main(string[] args)
        {
            Console.WriteLine((int)SystemVersion.Windows10);
            int n1 = 4;
            SystemVersion xp= (SystemVersion)n1;
            Console.WriteLine(xp);
            int n2 = 256;//不在枚举内的数值不会报错则会输出原来的值
            SystemVersion noEnumeration = (SystemVersion)n2;
            Console.WriteLine(noEnumeration);
        }
    }
}
